﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class mwc_admin_Panel : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        UserControl uc;
        try
        {
            /*if ((int)Session["Autorized"] != 1)
            {
                Response.Redirect("~/mwc_admin/Default.aspx");
            }
            else {*/
                string option = Request.QueryString.Get("option");
                //Response.Write("aaa:" + option);
                if (option != null)
                {
                    admin_control.Controls.Clear();
                    uc = (UserControl)LoadControl("controls/" + option + ".ascx");
                    admin_control.Controls.Add(uc);
                }
                else
                {
                    admin_control.Controls.Clear();
                    uc = (UserControl)LoadControl("controls/listcontent.ascx");
                    admin_control.Controls.Add(uc);
                }
            //}
        }
        catch {
            //Response.Redirect("~/mwc_admin/Default.aspx");
        }
    }
    protected void fnLogOut(object ob, EventArgs e)
    {
        Session.Remove("Authorized");
        Session.Remove("UserName");
        Response.Redirect("~/mwc_admin/Default.aspx");
    }
}
